home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / lang / Python16_Src.lha / Python16_Source / Modules / cgensupport.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-03  |  2.3 KB  |  64 lines

  1. #ifndef Py_CGENSUPPORT_H
  2. #define Py_CGENSUPPORT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. /* Definitions used by cgen output */
  8.  
  9. /* XXX This file is obsolete.  It is *only* used by glmodule.c. */
  10.  
  11. typedef char *string;
  12.  
  13. #define mknewlongobject(x) PyInt_FromLong(x)
  14. #define mknewshortobject(x) PyInt_FromLong((long)x)
  15. #define mknewfloatobject(x) PyFloat_FromDouble(x)
  16. #define mknewcharobject(ch) Py_BuildValue("c", ch)
  17.  
  18. #define getichararg PyArg_GetChar
  19. #define getidoublearray PyArg_GetDoubleArray
  20. #define getifloatarg PyArg_GetFloat
  21. #define getifloatarray PyArg_GetFloatArray
  22. #define getilongarg PyArg_GetLong
  23. #define getilongarray PyArg_GetLongArray
  24. #define getilongarraysize PyArg_GetLongArraySize
  25. #define getiobjectarg PyArg_GetObject
  26. #define getishortarg PyArg_GetShort
  27. #define getishortarray PyArg_GetShortArray
  28. #define getishortarraysize PyArg_GetShortArraySize
  29. #define getistringarg PyArg_GetString
  30.  
  31. extern int PyArg_GetObject Py_PROTO((PyObject *args, int nargs,
  32.                      int i, PyObject **p_a));
  33. extern int PyArg_GetLong Py_PROTO((PyObject *args, int nargs,
  34.                    int i, long *p_a));
  35. extern int PyArg_GetShort Py_PROTO((PyObject *args, int nargs,
  36.                     int i, short *p_a));
  37. extern int PyArg_GetFloat Py_PROTO((PyObject *args, int nargs,
  38.                     int i, float *p_a));
  39. extern int PyArg_GetString Py_PROTO((PyObject *args, int nargs,
  40.                      int i, string *p_a));
  41. extern int PyArg_GetChar Py_PROTO((PyObject *args, int nargs,
  42.                    int i, char *p_a));
  43. extern int PyArg_GetLongArray Py_PROTO((PyObject *args, int nargs,
  44.                     int i, int n, long *p_a));
  45. extern int PyArg_GetShortArray Py_PROTO((PyObject *args, int nargs,
  46.                      int i, int n, short *p_a));
  47. extern int PyArg_GetDoubleArray Py_PROTO((PyObject *args, int nargs,
  48.                       int i, int n, double *p_a));
  49. extern int PyArg_GetFloatArray Py_PROTO((PyObject *args, int nargs,
  50.                      int i, int n, float *p_a));
  51. extern int PyArg_GetLongArraySize Py_PROTO((PyObject *args, int nargs,
  52.                         int i, long *p_a));
  53. extern int PyArg_GetShortArraySize Py_PROTO((PyObject *args, int nargs,
  54.                          int i, short *p_a));
  55. extern int PyArg_GetDoubleArraySize Py_PROTO((PyObject *args, int nargs,
  56.                           int i, double *p_a));
  57. extern int PyArg_GetFloatArraySize Py_PROTO((PyObject *args, int nargs,
  58.                      int i, float *p_a));
  59.  
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif /* !Py_CGENSUPPORT_H */
  64.